<div style="margin: 15px 0px 0px 15px">
	<h3>Cập nhật thông tin quảng cáo</h3><hr />
	<div style="margin-top: 30px;  margin-left: 60px;">
	<div style="background: yellow;">
		<?php echo validation_errors();?>	
	</div>
		<?php $attrs = array('class'=>'frm_update_customer', 'id'=>'frm_update_customer')?>
		<?php echo form_open_multipart(base_url().'index.php/advertisement/update/'. $ad['id'], $attrs)?>
		<table cellpadding="10">
			<tr>
				<td width="150"><?php echo form_label('Tên quảng cáo')?></td>
				<td><?php echo form_input(array('name'=>'name','value'=> $ad['name'], 'size'=>'30'))?>
					<hr />
				</td>
			</tr>
			<tr>
				<td>
				<?php
					if($ad['type']=='banner'){
						echo "Banner and Link";
					}
					else
					{
						echo "Source";
					}
					
				?>
				</td>
				
				<td>
				<?php
					if($ad['type']=='banner'){
						echo '<img src="'.base_url(). $ad['image'].'" style="display: block"/>';
						echo '<input type="file" name="image"  size="20" /> <br><br>';
						echo '<input type = "text" name = "source" value = "'.$ad['source'].'" />';
					}
					else{
						echo form_textarea(array('name'=>'description' ,'value'=> $ad['source'],'size'=>'30'));
					}
				?>
					<hr />
				</td>
				
			</tr>
			<tr>
				<td><?php echo form_label('Mô tả')?></td>
				<td><?php echo form_textarea(array('name'=>'description', 'value'=> $ad['description'],'size'=>'30'))?>
					<hr />
				</td>
			</tr>
			<tr>
				<td><?php echo form_label('Vị trí')?></td>
				<td>
					<?php $positions = array('Trái'=>'Trái', 'Phải'=>'Phải');?>
					<?php echo form_dropdown('position',$positions, $ad['position'])?>
					<hr />
			</tr>
			<tr>
				<td><?php echo form_label('Hoạt động')?></td>
				<td>
					<?php $status = array('Có'=>'Có', 'Không'=>'Không');?>
					<?php echo form_dropdown('status',$status, $ad['status'])?>
					<hr />
			</tr>
			<tr>
				<td></td>
				<td>
					<input type = 'hidden' name = 'type' value =<?php echo $ad['type'];?>>
					<?php echo form_submit(array('name'=>'submit','value'=>'Cập nhật'))?>
				</td>
			</tr>
		</table>
	</form>
	</div>
</div>